<template>
  <div class="app-registry__step-three">
    <div class="app-registry__step-three__content">
      <input type="text" placeholder="输入密码" v-model="password">
      <button :disabled="disable" @click="NextStep">下一步</button>
    </div>
  </div>
</template>
<script>
export default {
  name: 'AppRegistryStepThree',
  props: ['tel'],
  data () {
    return {
      password: ''
    }
  },
  computed: {
    disable () {
      return !/^[1-9a-zA-Z]\w{5,11}$/.test(this.password)
    }
  },
  methods: {
    NextStep () {
      this.$router.push({ name: 'stepfour', params: { tel: this.tel, password: this.password } })
    }
  }
}
</script>
<style lang="scss" scoped>
.app-registry__step-three {
  &__content {
    padding: 0.16rem .35rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    input {
      width: 100%;
      height: 50px;
      margin: 20px 0;
      border: none;
      background: rgb(240, 240, 240);
      border-radius: 15px;
      padding: 0 20px;
      margin-top: 0;
    }
    button {
      width: 100%;
      height: 50px;
      border-radius: .4rem;
      border: none;
      background: rgb(84, 167, 250);
      font-size: 18px;
      color: white;
    }
    button:disabled {
      background: rgb(181, 218, 255);
    }
  }
}
</style>
